﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text;
using System.Security.Cryptography;
using System.Collections;

namespace BGCOP.CAVTOP.COMMON
{
    public class ClassSeguridad
    {

        public int Valor { get; set; }
        //    Function getMd5Hash(ByVal input As String) As String
        //    ' Create a new instance of the MD5 object.
        //    Dim md5Hasher As MD5 = MD5.Create()

        //    ' Convert the input string to a byte array and compute the hash.
        //    Dim data As Byte() = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input))

        //    ' Create a new Stringbuilder to collect the bytes
        //    ' and create a string.
        //    Dim sBuilder As New StringBuilder()

        //    ' Loop through each byte of the hashed data 
        //    ' and format each one as a hexadecimal string.
        //    Dim i As Integer
        //    For i = 0 To data.Length - 1
        //        sBuilder.Append(data(i).ToString("x2"))
        //    Next i
        //    ' Return the hexadecimal string.
        //    Return sBuilder.ToString()

        //End Function
        public byte[] GetMd5Hash(string input)
        {
            MD5 md5Hasher = MD5.Create();

            byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
            return data;
        }

    }
}
